package NowCoderHuaWei;

import java.util.Scanner;


public class Test14 {
	public static void main(String[] args)
	{
		Scanner in=new Scanner(System.in);
		while(in.hasNext())
		{
			int n=in.nextInt();
			
			String str[]=new String[n];
			for(int i=0;i<n;i++)
			{
				str[i]=in.next();
			}
			for(int i=0;i<str.length;i++)
			{
				for(int j=i+1;j<str.length;j++)
				{
					if(str[j].compareTo(str[i])<0)
					{
						String temp=str[j];
						str[j]=str[i];
						str[i]=temp;
					}
				}
			}
			for(String st:str)
			{
				System.out.println(st);
			}
		}
		in.close();
	}
}
/*
  public static void main(String[] args) {

    Scanner in=new Scanner(System.in);
    int n=in.nextInt();
    Vector<String> ve=new Vector<String>();
    for (int i = 0; i < n; i++) {
        ve.add(in.next());
    }
    Collections.sort(ve);
    Iterator it=ve.iterator();
    while(it.hasNext()){
        System.out.println(it.next());
    }
}
} */
